# -*- coding: utf-8 -*-

from django.conf.urls.defaults import *
from django.contrib import admin

import settings


admin.autodiscover() # load installed apps admin mobule


def redirect(url):
    from django.http import HttpResponseRedirect
    def inner(request):
        return HttpResponseRedirect(url)
    return inner


urlpatterns = patterns('',

    #url(r'^$',redirect('/app/')),

    # Enable the admin:
    #url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
    url(r'^admin/(.*)', admin.site.root),

     # development server also serve media:
    url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),

    #url(r'^$', include('magic8.urls')),
    url(r'^$', redirect('/cms/')),
    url(r'^cms/', include('cms.urls')),

    url(r'^cms/', include('cms.urls')),

    url(r'^projects/', include('djangoext.urls'), { 'admincls':'todo.models.ProjectConfig' } ),
    url(r'^timeregs/', include('djangoext.urls'), { 'admincls':'todo.models.TimeregConfig' } ),
    url(r'^projecttree/', include('djangoext.urls'), { 'admincls':'todo.models.ProjectTreeConfig' } ),

    url(r'^plugin1/', include('plugin1.urls')),
)
